package cn.tedu.boot011.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class BMIController {

    @RequestMapping("/bmi")
    @ResponseBody
    public String bmi(double h, double w){
        double data = w/(h*h);
        if (data<18.5){
            return "指标为"+data+",您的身体偏瘦";
        }else if (data<24){
            return "指标为"+data+",您的身体正常";
        }else if (data<28){
            return "指标为"+data+",您的身体微胖";
        }else {
            return "指标为"+data+",您的身体有点胖了";
        }
    }
}
